<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!-- 使用JSTL标签需要引入的头文件 -->
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!-- 使用fmt 对时间进行格式化的时候需要引入的头文件 -->
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<script type="text/javascript">
	function checkForm(){
		var nickName=document.getElementById("nickName").value;
		if(nickName==null||nickName==""){
			document.getElementById("error").innerHTML="昵称不能为空！";
			return false;
		}
		return true;
	}
</script>
</head>
<body>
<div class="data_list">
	<div class="data_list_title">
		<img src="${pageContext.request.contextPath}/images/user_edit_icon.png"/>
		个人信息设置
	</div>
	<div class="row-fluid" style="padding-top: 20px;">
		<div class="span3">
			<img src="${currentUser.imageName }">
		</div>

		<div class="span9">
			<form action="user?action=save" method="post" enctype="multipart/form-data" onsubmit="return checkForm()">
				<table width="100%">
					<tr>
						<td width="15%">头像路径:</td>
						<td><input type="file" id="imagePath" name="imagePath"/></td>
					</tr>
					<tr>
						<td>个人昵称:</td>
						<td><input type="text" id="nickName" name="nickName" value="${currentUser.nickName }" style="margin-top:5px;height:30px;"/></td>
					</tr>
					<tr>
						<td valign="top">个人心情:</td>
						<td><textarea id="mood" name="mood" rows="10" style="width: 100%">${currentUser.mood }</textarea></td>
					</tr>
					<tr>
						<td><button class="btn btn-primary" type="submit">保存</button></td>
						<td><button class="btn btn-primary" type="button" onclick="javascript:history.back()">返回</button>&nbsp;&nbsp;<font id="error" color="red">${error}</font></td>
					</tr>
				</table>
			</form>
		</div>
	</div>
</div>
</body>
</html>